export type isNegativeNumber<T extends number> = number extends T
  ? never
  : T extends number
  ? `${T}` extends `-${string}`
    ? T extends 0
      ? false
      : true
    : false
  : never;

export type isPositiveNumber<T extends number> = number extends T
  ? never
  : T extends number
  ? `${T}` extends `-${string}`
    ? false
    : T extends 0
    ? false
    : true
  : never;

type isNonNegativeNumber<T extends number> = isNegativeNumber<T> extends true
  ? never
  : T;

export type isEqual<A, B> = (<T>() => T extends A ? 1 : 2) extends <
  T1
>() => T1 extends B ? 1 : 2
  ? true
  : false;

export type CheckLeftIsExtendsRight<T extends any, R extends any> = T extends R
  ? true
  : false;

export type Not<C extends boolean> = C extends true ? false : true;

export type And<C1 extends boolean, C2 extends boolean> = C1 extends true
  ? C2 extends true
    ? true
    : false
  : false;

export type Or<C1 extends boolean, C2 extends boolean> = C1 extends true
  ? true
  : C2 extends true
  ? true
  : false;

export type NumberLike = number | `${number}`;
export type CanStringified =
  | string
  | number
  | bigint
  | boolean
  | undefined
  | null;
export type Stringify<T extends CanStringified> = `${T}`;
export type IsZero<N extends NumberLike> = CheckLeftIsExtendsRight<N, 0 | "0">;
export type IsOverZero<N extends NumberLike> = IsZero<N> extends true
  ? false
  : CheckLeftIsExtendsRight<
      Stringify<N> extends `${"-"}${infer Rest}` ? Rest : never,
      never
    >;

type x = IsOverZero<"10">;
